
package nc.impl.cmp.qdfkd.qdfkd;

import nc.bs.pfxx.plugin.AbstractPfxxPlugin;
import nc.vo.pub.BusinessException;
import nc.bs.pfxx.ISwapContext;
import nc.vo.pfxx.auxiliary.AggxsysregisterVO;
import nc.vo.pfxx.util.PfxxPluginUtils;
import nc.bs.framework.common.NCLocator;
import nc.vo.cmp.qdfkd.AggQdfkdVO;
import nc.itf.cmp.qdfkd.qdfkd.IQdfkdVOService;

public class QdfkdVOPfxxPlugin extends AbstractPfxxPlugin {
	
	@Override
	protected Object processBill(Object vo, ISwapContext swapContext, AggxsysregisterVO aggxsysvo)
			throws BusinessException {
		AggQdfkdVO entityVO = (AggQdfkdVO)vo;
		String vopk = PfxxPluginUtils.queryBillPKBeforeSaveOrUpdate(swapContext.getBilltype(), swapContext.getDocID());
		entityVO.getParentVO().setPrimaryKey(vopk);
		AggQdfkdVO[] saveVO = getService().saveAggQdfkdVO(entityVO);
		return saveVO;
	}
	
	private IQdfkdVOService getService() {
		return NCLocator.getInstance().lookup(IQdfkdVOService.class);
	}
}